<?

/**
* Fetch the amount of 
* down payment(DP/Prepaid) input
*
*/
fetchPrepaidDtl($COracle,
                $thisJobId,
                $srcDbHdr,
                $prepaid,
                $currency,
                $rate);

if($isApprove){          

  $status = _OUTSTANDING;
  
  /**
  * Need confirmation for this
  *
  */
  $used = 0;
  
  /**
  * Insert into DP db
  * and set status to _OUTSTANDING,
  * reference would take purchasing's
  *
  */
  insDP($COracle,
        $jobId,
        $srcDate,
        $currency,
        $rate,
        $used,
        $prepaid,
        $status,
        $srcDbDP);       
}else{
  
  $status = _CANCELED;
  
  /**
  * Update the A/P to Canceled
  *
  */
  updateAP($COracle,
           $thisJobId,
           $status,
           $srcDbDP);
}

?>